package cn.wxxyhw.dao;

import cn.wxxyhw.entity.Department;
import org.springframework.stereotype.Component;

import java.util.Collection;
import java.util.HashMap;
import java.util.Map;

@Component
public class DepartmentDao {
    private static Map<Integer, Department> map= new HashMap<>();
    static {
        map.put(1,new Department(1,"AAA_A"));
        map.put(2,new Department(1,"BBB_B"));
        map.put(3,new Department(1,"CCC_C"));
        map.put(4,new Department(1,"DDD_D"));
        map.put(5,new Department(1,"EEE_E"));
    }

    public Department getDepartmentById(int id){
        return map.get(id);
    }
    public Collection<Department> getAll(){
        return map.values();
    }
}
